<template>
	<view class="container">
		<radio-group @change="radioChange" v-model="from.content" :wrap="true">
			<label v-for="(item,index) in complaintList" :key="index">
				<view class="complaint-item">
					<radio class="radio" :value="item" color="#5543ef"></radio>
					<text>{{item}}</text>
				</view>
			</label>
		</radio-group>
 <view class="quit flex-center">
		    <view class="btn flex-center" @click="onSubmit">
		      提交
		    </view>
		 </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				complaintList: [
					"辱骂攻击",
					"色情低俗",
					"广告",
					"政治相关",
					"违法规格",
					"泄露他人隐私",
					"其它"
				],
				from: {
					post_id: '',
					content: ''
				}
			};
		},
		onLoad(options) {
			this.from.post_id = options.id;
		},
		methods: {
			onSubmit() {
						uni.showToast({
							title: "举报成功",
							icon: "none"
						}),

						setTimeout(() => {
							uni.navigateBack();
						}, 1000)
				
			},
			radioChange(e) {
				this.from.content = e.target.value;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.complaint-item {
		padding: 30rpx 0;
		margin: 0 30rpx;
		border-bottom: 1px solid #eee;
		display: flex;
	}

	.radio {
		display: block;
	}

.quit{
  height: 100rpx;
  margin-top: 50px;
  .btn{
    background-color: #4f99ff;
    border-radius: 30px;
    width: 80%;
    color: white;
    font-size: 1.2em;
    height: 100%;
  }
}
.flex-center{
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
